package cn.kgm.makeGod.condition;

import cn.kgm.makeGod.Character;
import lombok.Builder;
import lombok.Data;

/**
 * @Version 1.8
 * @Author: Kappi
 * @Date: 2025-9-11 14:38
 * @Description: cn.kgm.makeGod.condition.BattleCondition
 */
@Data
@Builder
public class BattleCondition implements Condition {
    private boolean canBattle;

    public BattleCondition() {
    }

    public BattleCondition(boolean canBattle) {
        this.canBattle = canBattle;
    }

    @Override
    public boolean check(Character actor, Character target, WorldState world) {
        // 简单的战斗条件检查：等级相差不超过5级
        return Math.abs(actor.getLevel() - target.getLevel()) <= 5;
    }
}
